<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="${ctxPath}/static/favicon.ico">
    <link rel="Shortcut Icon" href="${ctxPath}/static/favicon.ico"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="${ctxPath}/static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="${ctxPath}/static/lib/respond.min.js"></script>
    <![endif]-->
    <link href="${ctxPath}/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css"/>
    <link href="${ctxPath}/static/h-ui.admin.pro/css/H-ui.login.css" rel="stylesheet" type="text/css"/>
    <link href="${ctxPath}/static/lib/Hui-iconfont/1.0.9/iconfont.css" rel="stylesheet" type="text/css"/>
    <link href="${ctxPath}/static/business/css/style.css" rel="stylesheet" type="text/css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="${ctxPath}/static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>系统登录 - ${appName}</title>
    <meta name="keywords" content="${appName}">
    <meta name="description" content="${appName}">
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value=""/>
<input type="hidden" id="code" name="code" value="${result.code!0}"/>
<input type="hidden" id="msg" name="msg" value="${result.msg! }"/>
<div class="header"></div>
<div class="loginWraper">
    <div class="loginBox">
        <form id="form-admin-login" class="form form-horizontal" action="${ctxPath}/login" method="post">
            <div class="row clearfix">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="form-controls col-xs-7">
                    <input id="username" name="username" type="text" value="${username!}" placeholder="账号"
                           class="input-text size-L">
                </div>
            </div>
            <div class="row clearfix">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="form-controls col-xs-7">
                    <input id="password" name="password" type="password" value="${password!}" placeholder="密码"
                           class="input-text size-L">
                </div>
            </div>
            <div class="row clearfix">
                <div class="form-controls col-xs-7 col-xs-offset-3">
                    <input id="validateCode" name="validateCode" class="input-text size-L" type="text" placeholder="验证码" value="" style="width:120px;" maxlength="4">
                    <img id="validateImg" src="validate" title="点击刷新验证码" onclick="refreshValidateCode();"/>
                    <a href="javascript:;" onclick="refreshValidateCode();">看不清，换一张</a>
                </div>
                <div class="row cl">
                    <div class="formControls col-xs-8 col-xs-offset-3">
                    </div>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-7 col-xs-offset-3">
                    <input name="" type="submit" class="btn btn-success radius size-L btn-block" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
                </div>
                <div class="formControls col-xs-7 col-xs-offset-3 mt-20">
                    <input name="" type="button" class="btn btn-warning radius size-L btn-block" value="&nbsp;注&nbsp;&nbsp;&nbsp;&nbsp;册&nbsp;" onclick="layer_show('用户注册','${ctxPath}/registerForm')">
                </div>
            </div>
        </form>
    </div>
</div>
<div class="footer">Copyright by h-ui.admin.pro.iframe v1.2</div>
<script type="text/javascript" src="${ctxPath}/static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="${ctxPath}/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${ctxPath}/static/lib/layer/layer.js"></script>
<script type="text/javascript" src="${ctxPath}/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="${ctxPath}/static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="${ctxPath}/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="${ctxPath}/static/business/js/grq.js"></script>
<script type="text/javascript">
    $(function () {
        if (self != top) {
            window.top.location.replace(self.location);
        }

        $("#form-admin-login").validate({
            rules: {
                username: {
                    required: true,
                },
                password: {
                    required: true,
                    rangelength: [6, 32]
                },
                validateCode: {
                    required: true,
                }
            },
            messages: {
                username: {
                    required: "用户名不能为空"
                },
                password: {
                    required: "密码不能为空",
                    rangelength: "密码长度6到32个字符"
                },
                validateCode: {
                    required: "验证码不能为空"
                },
            },
            submitHandler: function (form) {
                loading();
                form.submit();
            }
        });


        var code = $("#code").val();
        var msg = $("#msg").val();
        if (code > 0) {
            layer_msg(code, msg);
        }

    });

    function refreshValidateCode() {
        var validateImg = document.getElementById("validateImg");
        validateImg.src = "validate?timestamp=" + new Date();
    }

    function layer_show(title,url,w,h){
        if (title == null || title == '') {
            title=false;
        };
        if (url == null || url == '') {
            url="404.html";
        };
        if (w == null || w == '') {
            w=800;
        };
        if (h == null || h == '') {
            h=($(window).height() - 50);
        };
        layer.open({
            type: 2,
            area: [w+'px', h +'px'],
            fix: false, //不固定
            maxmin: true,
            shade:0.4,
            title: title,
            content: url
        });
    }
</script>
</body>
</html>
